<?php

namespace Api\Http\Controllers;

use Api\traits\ApiResponse;
use Catch\Traits\DB\BaseOperate;
use Illuminate\Http\Request;
use Api\Http\Controllers\Controller;
use Modules\Collage\Models\Banner;
use Modules\Collage\Models\Guide;
use Modules\Collage\Models\Resources;
use Modules\Member\Models\Cooperate;
class CollageController extends  Controller
{
    use ApiResponse;
    public function bannerList()
    {
        $list =  Banner::where('is_visible',1)->orderBydesc('sort')->get()->toArray();
        return $this->data($list);
    }

    public function guideList()
    {
        $list =  Guide::where('is_visible',1)->orderBydesc('sort')->get()->toArray();
        return $this->data($list);
    }

    public function resourcesList($type)
    {
        $list =  Resources::where('is_visible',1)->where('type',$type)->orderBydesc('sort')->paginate(10)->toArray();
        return $this->data($list);
    }
}
